package com.imut.lagain.entity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import java.time.LocalDateTime;

/**
 * 记忆条目实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("memory_entry")
public class MemoryEntry {
    private static final Logger log = LoggerFactory.getLogger(MemoryEntry.class);

    
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 所属胶囊ID
     */
    @NotNull(message = "胶囊ID不能为空")
    @TableField("capsule_id")
    private Long capsuleId;
    
    /**
     * 条目类型（1-文本，2-图片，3-音频，4-视频）
     */
    @TableField("type")
    private Integer type;
    
    /**
     * 条目类型字符串（text-文本，image-图片，audio-音频，video-视频）
     */
    @TableField("entry_type")
    private String entryType;
    
    /**
     * 条目内容（文本内容）
     */
    @Size(max = 5000, message = "条目内容长度不能超过5000个字符")
    @TableField("content")
    private String content;
    
    /**
     * 文件URL（如果是媒体文件）
     */
    @Size(max = 500, message = "文件URL长度不能超过500个字符")
    @TableField("file_url")
    private String fileUrl;
    
    /**
     * 文件名
     */
    @Size(max = 255, message = "文件名长度不能超过255个字符")
    @TableField("file_name")
    private String fileName;
    
    /**
     * 文件大小（字节）
     */
    @TableField("file_size")
    private Long fileSize;
    
    /**
     * 文件类型
     */
    @Size(max = 100, message = "文件类型长度不能超过100个字符")
    @TableField("file_type")
    private String fileType;
    
    /**
     * 排序顺序
     */
    @TableField("sort_order")
    private Integer sortOrder = 0;
    
    /**
     * 媒体时长（秒）- 用于音频和视频
     */
    @TableField("duration")
    private Integer duration;
    
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    /**
     * 是否删除(1-已删除, 0-未删除)
     */
    @TableLogic
    @TableField("is_deleted")
    private Boolean isDeleted = false;
    
    /**
     * 删除时间
     */
    @TableField("deleted_at")
    private LocalDateTime deletedAt;
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getId() {
        return id;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
    public String getContent() {
        return content;
    }
    
    public void setCapsuleId(Long capsuleId) {
        this.capsuleId = capsuleId;
    }
    
    public Long getCapsuleId() {
        return capsuleId;
    }
    
    public void setEntryType(String entryType) {
        this.entryType = entryType;
    }
    
    public String getEntryType() {
        return entryType;
    }
    
    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }
    
    public Integer getSortOrder() {
        return sortOrder;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    
    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }
    
    public Boolean getIsDeleted() {
        return isDeleted;
    }
    
    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }
    
    public String getFileUrl() {
        return fileUrl;
    }
    
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
    
    public String getFileName() {
        return fileName;
    }
    
    public void setFileType(String fileType) {
        this.fileType = fileType;
    }
    
    public String getFileType() {
        return fileType;
    }
    
    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }
    
    public Long getFileSize() {
        return fileSize;
    }
    
    public void setDuration(Integer duration) {
        this.duration = duration;
    }
    
    public Integer getDuration() {
        return duration;
    }
    
    public void setDeletedAt(LocalDateTime deletedAt) {
        this.deletedAt = deletedAt;
    }
    
    public LocalDateTime getDeletedAt() {
        return deletedAt;
    }
}
